<?php
	include '../models/MainWord.php';
	require '../utils/conn.php';
	$query = "SELECT * FROM main_word order by content ASC";
	if ($letter != "") {
		$query = "SELECT * FROM main_word WHERE word_index='$letter' order by content ASC";
	}
	
	echo $query;
	echo "<br/>";
	$words = array();
	$result = mysql_query($query);
	while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
	{
		$mainWord = new MainWord();
		$mainWord->setWordId($row['word_id']);
		$mainWord->setContent($row['content']);
		$mainWord->setSlug($row['slug']);
		$mainWord->setCreateTime($row['create_time']);
		$mainWord->setWordIndex($row['word_index']);
		
		
		echo "\twordId:". $mainWord->getWordId();
		echo "\tcontent:". $mainWord->getContent();
		echo "\tword_index:". $row['word_index'];
		echo "\tslug:". $row['slug'];
		echo "\tcreateTime:". $row['create_time'];
		echo "<br/>";
		echo "<br/>";
	}
?>